/*
Copyright (C) 2022-2024 Inspur Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0
*/
package constant

import "github.com/pkg/errors"

const (
	DefaultSalt        = "inspur1029!@"
	DefaultPwd         = "83bc3b49bcf3903e3036f8a81bda3ba21bd93ccd620fd922b80593bab7733a94"
	DefaultKeyAlgo     = "Sm2p256v1"
	DefaultKeyAlgoCode = "00"

	DefaultContext                = "https://w3id.org/did/v1"
	DefaultVersion                = "1"
	DefaultKey1Subfix             = "#keys-1"
	DefaultKey2Subfix             = "#keys-2"
	DefaultServiceResolveSubfix   = "#resolver"
	DefaultServiceResolveType     = "DIDResolve"
	DefaultServiceResolveEndpoint = "https://localhost:8090/"

	TimeLayout = "2006-01-02 15:04:05"
	Status0    = "0"
	Status1    = "1"
	Status2    = "2"

	StatusAudit      = "0" // 待审核
	StatusNormal     = "1" // 正常
	StatusDeactivate = "2" // 停用

	VerifiablePresentation        = "VerifiablePresentation"
	Authentication                = "Authentication"
	CredentialContext             = "https://www.w3.org/2018/credentials/v1"
	CredentialRevocationUrlSuffix = "/v1/credential/revocation"

	DidResolveUrlSuffix    = "/v1/did/resolve"
	Lite                   = "lite"
	SimpleRevocationListV1 = "SimpleRevocationListV1"

	TypeSimpleRevocationListV1 = "00"
	SignTypeSm2p256v1          = "00"
	CptTypeLite                = "00"
	CptClaimStatusValid        = "1"

	CptClaimValueTypeString = "00"
	CptClaimValueTypeNum    = "01"
	CptClaimValueTypeBool   = "02"
	CptClaimValueTypeDate   = "03"

	CredentialOnChainTypeHash   = "1"
	CredentialOnChainTypeMerkle = "2"

	CredentialStatusInReview = "0"
	CredentialStatusValid    = "1"
	CredentialStatusInvalid  = "2"

	PresentationStatusInvalid = "0"
	PresentationStatusValid   = "1"

	IssuerStatusOk = "1"

	DidValidStatus      = "1"
	UserTypeAdmin       = "0"
	UserTypePerson      = "1"
	UserTypeIssuer      = "2"
	UserTypeEnterprise  = "3"
	UserStatusNormal    = "0"
	UserStatusNotNormal = "1"

	DefaultPageSize = 10
	MaxPageSize     = 100

	EncodeFormatHex    = "hex"
	EncodeFormatBase64 = "base64"

	AlgGM         = "GM"
	AlgSW         = "SW"
	HashAlgSm3    = "GMSM3"
	HashAlgSha256 = "SHA2"

	DefaultChainLogLevel = "error"
	DefaultVpDomain      = "inspur.com"
)

var (
	ErrorDidUsed = errors.New("did正在被使用，无法删除")
)
